'use strict';

var should = require('should');
var moment = require('moment');
var POP3 = require(__dirname + '/pop3');
var _ = require('lodash');
var async = require('async');

var conf = {
  hostname: 'pop3.126.com',
  username: 'xxxxxxx@126.com',
  password: 'xxxxx'
};

describe('fetcher pop3', function () {
  it('should get content from "sina.com" works fine', function (done) {
    var pop3 = new POP3(conf);
    pop3.getContent('2015-05-10');
    pop3.on('message', function (data) {
      console.log('data:',data);
    });
    pop3.on('error', function (err) {
      console.log('Test Error:',err);
    });
    pop3.on('end', function (msg) {
      console.log('msg:',msg);
      console.log('END');
      done();
    });
  });
});